<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
        <li class="active" ng-bind="title"></li>
        <a style="float: right;margin-right: 12%;margin-top: -10px;" 
			has-permission permission='funScenes.activity.add'	ui-sref="main.funScenes.activity.create" class="btn btn-sm btn-info">
			<i class="icon-tag m-r-sm text-md"></i>添加活动</a>
    </ul>
</div>

<!-- 加载提醒 -->
<div ng-show="loading" class="text-center m-t-md text-lg"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>

<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
    <!-- 数据显示 -->
    <div class="wrapper-data">
        <div class="panel panel-default">
            <!-- 头部 -->
            <div class="panel-body">
				<form ng-submit="searchRe()" class="form-horizontal">
                   	<div class="form-group">
                   		<!-- <div class="col-sm-2">
                           	<input type="text" class="form-control" placeholder="请输入活动ID" ng-model="param.id">
                       	</div> -->
                   	
                   		<div class="col-sm-2">
                           	<select class="form-control" ng-model="param.status">
                           		<option value="">--全部状态--</option>
                       			<option value="1">报名未开始</option>
                       			<option value="2">报名进行中</option>
                       			<option value="3">报名结束</option>
                       			<option value="4">活动未开始</option>
                       			<option value="5">活动进行中</option>
                       			<option value="6">活动已结束</option>
                       		</select>
                       	</div>
                       	
                   		<div class="col-sm-2">
                   			<input type="text" class="form-control" placeholder="请输入主办地" ng-model="param.city">
                   			<!-- <select class="form-control" ng-model="param.city" ng-options="d for d in cityList" id="city">
								 <option value="">--全部主办地--</option>
		                    </select> -->
                       	</div>
                       	
                   		<div class="col-sm-2">
                           	<input type="text" class="form-control" placeholder="请输入活动名称" ng-model="param.theme">
                       	</div>
                       	
                       	<div class="col-sm-6">
                            <label class="col-sm-2"><button class="ifc-btn btn-primary" type="submit">查 询</button></label>
                            <label class="col-sm-2"><button class="ifc-btn btn-dark" type="button" ng-click="clearSearch()">重  置</button></label>
                        </div>
                   	</div>
				</form>
            </div>

            <!-- 数据表格 -->
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-center">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>活动ID</th>
                        <th>活动名称</th>
                        <th>主办地</th>
                        <th>报名时间</th>
                        <th>开始时间</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="item in pageInfo.records">
                        <td class="v-middle">{{$index + 1}}</td>
                        <td class="v-middle">{{item.activityId}}</td>
                        <td class="v-middle" title="{{item.activityName}}">{{item.activityName | limitTo:10}}</td>
                        <td class="v-middle">{{item.city}}</td>
                        <td class="v-middle">{{item.preStartTime}} - {{item.preEndTime}}</td>
                        <td class="v-middle">{{item.startTime}} - {{item.endTime}}</td>
                        <td class="v-middle">{{item.statusDesc}}</td>
                        <td class="v-middle">
                        	<a ui-sref="main.funScenes.activity.detail({id: item.activityId})" class="btn btn-sm btn-default">
                                <i class="fa fa-info m-r-xs text-sm"></i>详情</a>
                                
                            <button type="button" ng-if="item.isModify=='Y' && item.havTask <= 0" ui-sref="main.funScenes.activity.update({id: item.activityId})" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-edit m-r-xs text-sm"></i>修改</button>
                                
                            <!-- <button type="button" ng-if="item.isModify=='Y'" ng-click="delActivity(item.activityId)" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-check m-r-xs text-sm"></i>删除</button> -->
                            <button type="button" ng-if="item.isEnable=='Y' && (item.status=='3' || item.status=='2' || item.status=='1')  " ng-click="enableActivity(item.activityId,'N')" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-ban m-r-xs text-sm"></i>停用</button>
                                
                            <button type="button" ng-if="item.isEnable=='N' && (item.status=='3' || item.status=='2' || item.status=='1')  " ng-click="enableActivity(item.activityId,'Y')" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-check m-r-xs text-sm"></i>启用</button>
                                
                            <button type="button" ng-if="item.isRecommend=='N' && (item.status=='3' || item.status=='2' || item.status=='1') && item.havTask > 0" ng-click="recActivity(item.activityId)" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-arrows m-r-xs text-sm"></i>推荐</button>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
			<span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
        </div>
    </div>
</div>